home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Technotools
/
Technotools (Chestnut CD-ROM)(1993).ISO
/
os2tools
/
aping
/
cpicinit.h
< prev
next >
Wrap
Text File
|
1992-06-14
|
10KB
|
204 lines
/*****************************************************************************
*
* MODULE NAME : CPICINIT.H
*
* COPYRIGHTS:
* This module contains code made available by IBM
* Corporation on an AS IS basis. Any one receiving the
* module is considered to be licensed under IBM copyrights
* to use the IBM-provided source code in any way he or she
* deems fit, including copying it, compiling it, modifying
* it, and redistributing it, with or without
* modifications. No license under any IBM patents or
* patent applications is to be implied from this copyright
* license.
*
* A user of the module should understand that IBM cannot
* provide technical support for the module and will not be
* responsible for any consequences of use of the program.
*
* Any notices, including this one, are not to be removed
* from the module without the prior written consent of
* IBM.
*
* AUTHOR: Peter J. Schwaller
* VNET: PJS at RALVM6 Tie Line: 444-4376
* Internet: pjs@ralvm6.vnet.ibm.com (919) 254-4376
*
* AVAILABILITY:
* These sample programs and source are also available on
* CompuServe through the APPC Information Exchange. To get
* to the APPC forum just type 'GO APPC' from any CompuServe
* prompt. The samples are available in the Sample Programs
* library section. Just search on the keyword CPICPGMS to
* find all the samples in this series.
*
* Updates for the sample programs and support for many more
* CPI-C platforms will also be made available on CompuServe.
*
* RELATED FILES:
* CPICINIT.C
*
*****************************************************************************/
/*****************************************************************************
*
* OVERVIEW OF CPICINIT CALLS
*
* cpicinit_new() Creates a CPICINIT object.
* This must be done before any other
* cpicinit calls can be used.
*
* cpicinit_default_tp_name() These calls set the initial values
* cpicinit_default_mode_name() for CPICINIT parameters. These should
* cpicinit_default_destination() all be issued right after the CPICINIT
* cpicinit_default_sym_dest_name() object is created.
*
* cpicinit_set_tp_name() These calls also set the values for
* cpicinit_set_mode_name() CPICINIT parameters. These calls should
* cpicinit_set_destination() be used to set values from user input
* or profile values.
*
* Security calls - only available where supported by CPI-C
* cpicinit_set_userid Sets the userid for the conversation.
* cpicinit_set_passwd Sets the password for the conversation.
* cpicinit_query_passwd_required If a userid was set, then a password
* is required.
* cpicinit_get_passwd Let cpicinit prompt the user for a
* password.
* cpicinit_set_security_none Do not use any security on this conv.
*
* cpicinit_setup_conversation() Handles all CMINIT and set calls.
* Should be used by the calling program
* instead of CMINIT. See description
* of the procedure for more details.
*
* cpicinit_destroy() Destroys the CPICINIT object.
*
* cpicinit_pln_valid() These are internal calls used by
* cpicinit_mode_valid() cpicinit_setup_conversation.
*
*****************************************************************************/
#ifndef INCL_CPICINIT
#define INCL_CPICINIT
/*
* Collection of routines with special ported version for each platform
* The only thing that is used from CPICPORT.H is the correct setting
* of the SHORT_IDENTIFIERS identifier.
*/
#include "cpicport.h"
#if defined(SHORT_IDENTIFIERS)
/*
* Some compilers require that identifiers be unique in the 1st 8 chars.
* Any new functions should be added to this list.
*/
#define cpicinit_new cinew
#define cpicinit_default_tp_name cidtp
#define cpicinit_default_mode_name cidmode
#define cpicinit_default_destination ciddest
#define cpicinit_set_tp_name cistp
#define cpicinit_set_mode_name cismode
#define cpicinit_set_destination cisdest
#define cpicinit_default_sym_dest_name cidsdn
#define cpicinit_setup_conversation cisc
#define cpicinit_destroy cid
#define cpicinit_pln_valid cipv
#define cpicinit_mode_valid cimv
#define cpicinit_set_userid cisu
#define cpicinit_set_passwd cisp
#define cpicinit_query_passwd_required ciqpr
#define cpicinit_get_passwd cigp
#endif
/* A string of 8 blanks is a special symbolic destination name. We define */
/* this constant here rather than typing out 8 blanks within code. */
#define BLANK_SYM_DEST_NAME " "
/*
* This structure contains all of the information necessary to for all
* cpicinit calls. The standard CPI-C destination and partner information
* is stored. These values can be changed by the program through the
* use of cpicinit_default... and cpicinit_set... calls.
*/
typedef struct cpicinit {
char def_sym_dest_name[MAX_SYM_DEST_NAME];
/* Default symbolic dest name */
char tp_name[MAX_TP_NAME]; /* Transaction Program name */
int set_tp_name; /* Was tp name set? */
char mode_name[MAX_MODE_NAME]; /* Mode name */
int set_mode_name; /* Was mode name set? */
char destination[MAX_FQPLU_NAME];
/* Destination - may be either */
/* a sym dest name or a partner */
/* lu name */
int set_destination; /* Was destination set? */
char userid[MAX_USERID]; /* Userid */
int set_userid; /* Was userid set? */
char passwd[MAX_PASSWD]; /* Password */
int set_passwd; /* Was password set? */
int security_none; /* Was security=NONE specified? */
int show_error; /* Should we show errors? */
} CPICINIT;
/*
* Some of the fields in the CPICINIT object indicate whether another
* field has been set or not. These fields will have one of the following
* values. defines have been used to make the code more readable and to
* protect against the need to change these values in the future.
*/
#define SET 1
#define NOT_SET 0
/* function prototypes for this module */
/* create a new CPICINIT object */
CPICINIT * cpicinit_new(void);
/* Initialize defaults for CPICINIT values */
int cpicinit_default_tp_name( CPICINIT * cpicinit,
char * tp_name);
int cpicinit_default_mode_name( CPICINIT * cpicinit,
char * mode_name);
int cpicinit_default_destination( CPICINIT * cpicinit,
char * destination);
int cpicinit_default_sym_dest_name( CPICINIT * cpicinit,
char * def_sym_dest_name);
/* Set new values, based on user input or profile values */
int cpicinit_set_tp_name( CPICINIT * cpicinit,
char * tp_name);
int cpicinit_set_mode_name( CPICINIT * cpicinit,
char * mode_name);
int cpicinit_set_destination( CPICINIT * cpicinit,
char * destination);
int cpicinit_set_userid( CPICINIT * cpicinit,
char * userid);
int cpicinit_set_passwd( CPICINIT * cpicinit,
char * passwd);
int cpicinit_query_passwd_required( CPICINIT * cpicinit);
void cpicinit_get_passwd( CPICINIT * cpicinit);
void cpicinit_set_security_none( CPICINIT * cpicinit);
/* This call will prepare the conversation id for the Allocate call */
int cpicinit_setup_conversation( CPICINIT * cpicinit,
unsigned char * cm_conv_id,
CPICERR * cpicerr);
/* destroys the CPICINIT object created with cpicinit_new() */
void cpicinit_destroy( CPICINIT * cpicinit);
/* Internal routines */
int cpicinit_pln_valid( unsigned char * cm_conv_id);
int cpicinit_mode_valid( unsigned char * cm_conv_id);
#endif